package com.demo.controller;


import cn.hutool.core.collection.CollUtil;


import java.util.*;


public class FilterDemo {

    public static void main(String[] args) {

        Map<String , Object> map = new HashMap<String , Object>(){{
            put("K1", "A");
            put("K2", "B");
            put("K3" , "C");
        }};
        List<String> k1 = Arrays.asList("K1");

        Map<String, Object> filter = CollUtil.filter(map, new cn.hutool.core.lang.Filter<Map.Entry<String, Object>>() {
            @Override
            public boolean accept(Map.Entry<String, Object> stringObjectEntry) {
                if (!k1.contains(stringObjectEntry.getKey())) {
                    return true;
                }
                return false;
            }
        });

        System.out.println(filter);
    }
}
